package com.hz.house.controller.home;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hz.house.service.home.HomePageService;
import com.hz.house.token.CurrentUser;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/api/v2/home")
@Api("首页相关的所有接口都在这里")
public class HomePageController {
	
	@Autowired
	private HomePageService hps;
	
	/**
	 * <p> 获取首页的顶部轮播广告，中部的轮播广告，搜索框内占位的楼盘名称广告，
	 * <p> 搜索页内的热门楼盘名字广告，那5个列表内的轮播滚动广告
	 * @return
	 */
	@ApiOperation(value = "根据不同的广告位置拉取banner广告数据")
	@GetMapping("/getGuangGao")
	public Object getGuangGao(String type) {
		return hps.getGuangGao(type);
	}

	@ApiOperation(value = "根据不同的广告位置拉取banner广告数据")
	@GetMapping("/getGuangGaoV2_2")
	public Object getGuangGaoV2_2(String type) {
		return hps.getGuangGaoV2_2(type);
	}
	
	@ApiOperation(value = "获取筛选栏查询条件数据")
	@GetMapping("/getConditions")
	public Object getSearchConditions() {
		return this.hps.getSearchConditions();
	}
	
//	@ApiOperation(value = "获取每个分类的数据值，找房的标签，金牌置业顾问这三项数据")
//	@GetMapping("/getOthersV2_1")
//	public Object getOtherDataV2_1() {
//		return this.hps.getOtherDataV2_1();
//	}
	
	@ApiOperation(value = "获取每个分类的数据值，找房的标签，金牌置业顾问这三项数据")
	@GetMapping("/getOthersV2_2")
	public Object getOtherDataV2_2() {
		return this.hps.getOtherDataV2_2();
	}
	
	@ApiOperation(value = "获取每个分类的数据值，找房的标签，金牌置业顾问这三项数据")
	@GetMapping("/getOthersV2_3")
	public Object getOtherDataV2_3() {
		return this.hps.getOtherDataV2_3();
	}
	
	@ApiOperation(value = "获取标签找房条件标签")
	@GetMapping("/getAllTags")
	public Object getTagConditions() {
		return hps.getTagConditions();
	}
	
	@ApiOperation(value = "获取热搜楼盘的名字广告数据")
	@GetMapping("/getHotSearch")
	public Object getHotSearchBuildingNames() {
		return this.hps.getHotSearchBuildingNames();
	}
	
	@ApiOperation(value = "获取搜索框内的占位楼盘名字广告数据")
	@GetMapping("/getHoldplaceNames")
	public Object getSearchInputHoldpalce() {
		return this.hps.getSearchInputHoldpalce();
				
	}
	
	@ApiOperation(value = "获取独家报道的文章标题")
	@GetMapping("/getDjbds")
	public Object getDuJiaReport() {
		return this.hps.getDuJiaReport();
	}
	
	@ApiOperation(value = "获取房产新闻数据列表")
	@GetMapping("/getFcxwlist")
	public Object getFangChanNewList(Integer page) {
		return  this.hps.getFangChanNewList(page);
	}
	
	@ApiOperation(value = "获取首页----下部的各类别楼盘推荐数据，一起返回的")
	@GetMapping("/getTuiJianLp")
	public Object getTuiJianLp() {
		return this.hps.getTuiJianLp();
	}

	@ApiOperation(value = "获取独家报道的文章标题2_2")
	@GetMapping("/getDjbdsV2_2")
	public Object getDuJiaReportV2_2() {
		return this.hps.getDuJiaReportV2_2();
	}
	
	@ApiOperation(value = "获取早报的列表")
	@GetMapping("/getZaoBaoList")
	public Object getZaoBaoList(Integer page) {
		return this.hps.getZaoBaoList(page);
	}
	
	
	@ApiOperation(value = "获取早报详情")
	@GetMapping("/getZaoBaoDetail")
	public Object getZaoBaoDetail(Integer id) {
		return this.hps.getZaoBaoDetail(id);
	}
	
	@ApiOperation(value = "生成早报海报，如果是置业顾问，普通用户扫码进入后要加分")
	@GetMapping("/createZbPost")
	public Object getZaoBaoPost(Integer zaoBaoId) {
		return this.hps.getZaoBaoPost(zaoBaoId, CurrentUser.getCurrentUserId());
	}
	
	
}
